﻿using System;

namespace XTengine.ComponentModel
{
    public class SingleConverter : TypeConverter<Single>
    {
        public override Single ConvertFrom(string value)
        {
            Single result;
            if (Single.TryParse(value, out result))
            {
                return result;
            }

            return 0f;
        }

        public override string ConvertTo(Single value)
        {
            return value.ToString();
        }
    }
}